package com.tree;
//二叉树 的节点
public class Node {
     Object value;  //二叉树的值
     Node leftChild;//左子树的值
     Node rightChild;//右子树的值
    //方便初始化节点
    public Node(Object value, Node leftChild, Node rightChild) {
        this.value = value;
        this.leftChild = leftChild;
        this.rightChild = rightChild;
    }
     //方便初始化头节点
    public Node(Object value) {
        this.value = value;
    }
    //显示节点的值
    @Override
    public String toString() {
        return "Node{" +
                "value=" + value +
                ", leftChild=" + leftChild +
                ", rightChild=" + rightChild +
                '}';
    }
}
